|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 11:28:00 -
[1]
This IS the simpliest code snip
Originally by: Sleepkevert
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
As you do not know what that means, I presume you don't know what PHP is and just heard from a friend that it's cool.
But this board is for people looking for help, so what excactly do you plan? Maybe we can help you with that or talk you out of it 
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 13:02:00 -
[2]
Well, well ... where to start ....
First, you are doing it totally wrong :)
You tried to put PHP code into an XML. That will never work because the web server will say "oh, it's an XML, so I read it from the disc and send it to the user". It will not interpret the code within!
If your web server is configured to interpret php (afaik default to apache or tomcat), the server will work with this:
Create a file named "test.html"
<html>
<body>
Players:
<?
$string = file_get_contents("http://api.eve-online.com/server/ServerStatus.xml.aspx");
$xml = new SimpleXMLElement($string);
print($xml->result->onlinePlayers);
?> </body> </html>
The code between <? and ?> is then "compiled" and executed on the server, if you request the file. If you call e.g. http://localhost/test.html, the result should be Players: 12345 .
I may haved missed something, because I wrote this without any test. But any further info should be found on Google with "php turorial" :-)
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.20 13:48:00 -
[3]
Originally by: Commander Ventura Edited by: Commander Ventura on 20/10/2009 13:37:17 ok i did that it worked first time but not the second time =(
http://www.uk-time.co.cc/api/test.html
Hmmm... I get "Players:24120" and after several reloads "Players:24296"
I think it works! 
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.21 13:57:00 -
[4]
Edited by: Lutz Major on 21/10/2009 13:59:43
Originally by: Catari Taga ....
Of course ... how could I miss that! 
Here is what I think:
[-]>[-]< >+++++++++[<+++++++++>-]<--------. >++++++[<------>-]<-----. >++++++++[<++++++++>-]<++++. >+++[<+++>-]<++. >+++++++++[<--------->-]<++. >+++++++++[<+++++++++>-]<---. +. >++[<++>-]<+. >+++++++++[<--------->-]<---. >++++++++[<++++++++>-]<+++. --. >++++[<++++>-]<+. >++++[<---->-]<+++. >++++++++[<-------->-]<----.
The first who can translate it, will get 1 million ISK 
|

Lutz Major
Austriae Est Imperare Orbi Universo
|
Posted - 2009.10.21 14:41:00 -
[5]
Originally by: Kravek
This is program written in Brain****. I`m to lazy to translate this to something readable 
It got output: "I do not care!"
Congratulations, I just won one million ISK! I'll transfer the money as soon as I will log in again 
With it I meant, I do not care, whether there are three lines of code or just two :-) IMHO the mock-up by Sleepkevert was sufficient.
More of a problem will be the caching and error handling, if the api is (yet again) not available.
Regards, Lutz
|
|
|
|